<template>
    <div>
       <h2>你好啊{{ a }}</h2>
       <svg-icon name="phone" color="yellow" width="100px" height="100px" ></svg-icon>
       <button @click="getuseInfo">测试获取用户信息</button>
    </div>
  </template>
  
  <script setup lang="ts">
  import { ref } from 'vue';
  import userApi from '@/api'
  
  const a = ref(1)
  
  async function getuseInfo(){
  
  /*  axios({
    url:'/api/user/login',
    method:'post', 
    data:{
        username:'admin',
        password:'1234ab'
    }
    }).then(res=>{
        console.log("resolve",res)
    }).catch(err=>{
        console.log("reject",err)
    }) */
    try{
      const resule = await userApi.user.login({
        username:'admin',
        password:'1234abc'
      })
     console.log(resule);
    }catch(err){
      console.log(err)
    }
  }
  
  </script>
  
  <style lang="scss" scoped>
        h2{
          color:$color
        }
  </style>